<?php

namespace app\admin\framework\validate;

use taoser\Validate;

class UserValidate extends Validate
{
    
    
    protected $rule = [
        'username' => 'require|max:16',
        'nickname' => 'require|max:16',
        'mobile' => 'require|unique:user,mobile',
    ];
    
    protected $message = [
        'mobile.require' => '请填写手机号码',
        'mobile.unique' => '该手机号码已存在',
        
        'username.require' => '请输入用户名',
        'nickname.require' => '请输入昵称',
    ];
    
    protected $scene = [
        'add' => ['username', 'nickname', 'mobile'],
        'edit' => ['username', 'nickname', 'mobile'],
    ];
}
